<div class="container wx_wrap mini-innner">
    <div class="row">
        <div class="col-md-12 p0">
            <div class="wx_bar">
                <div class="wx_bar_back"><a id="indexBack" href="<?php echo $back_url?>"></a></div>
                <div class="wx_bar_tit">收货地址</div>
                <!--  
                <a  class="set_default" style="font-size: 16px;position: absolute;top: 0px;bottom: 10px;right: 20px;" href="/payment_js/index">确定</a>
                -->
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12">
            <div class="address_list" id="addressList" style="-webkit-transform-origin: 0px 0px; opacity: 1; -webkit-transform: scale(1, 1);">
                <?php foreach ($add_list as $address):?>
                <div class="address">
                    <ul <?php if(session('default_address_id') == $address['id']) echo 'class="selected"';?>>
                        <li><strong><?php echo $address['consignee']?></strong> <?php echo $address['mobile']?></li>
                        <li class="temp_click" rel="/cart/setdefault/address_id/<?php echo $address['id']?>.html"><?php echo $address['address']?></li>
                        <li class="edit" url="/cart/edit/address_id/<?php echo $address['id']?>.html" ><a href="javascript:void(0);">编辑</a></li><!--点击跳至修改页面，和新增页面样式相同-->
                    </ul>
                </div>
                <?php endforeach;?>
                <div class="wap_page" style="text-align:center;">
                </div>
                <div class="address_list_link">
                    <a href="/member/address/add.html" class="item item_new" id="new">新增收货人与地址</a><!--点击跳至新增页面-->
                </div>
            </div>
        </div>
    </div>
</div>
<script>
$(document).ready(function(){
    $('.address ul').click(function() {

        $('.address ul').removeClass('selected');
        $(this).addClass('selected');
        showPageLoadingMsg('处理中...');
        if($(this).find('.edit').attr('rel')){
            alert($(this).find('.edit').attr('rel'));
        } else {
            var url = $(this).find('.temp_click').attr('rel');
            setTimeout(function(){location.href=url;},2000);
        }


    });

    $('.edit').click(function() {
        var url = $(this).attr('url');
        location.href=url;
    });
});

</script>